package com.example.flashsales.mappers;

import com.example.flashsales.entity.pojo.AdminCostRecord;
import com.example.flashsales.entity.vo.AdminCostRecordVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface AdminCostRecordMapper {

    //添加一条流水纪录
    int addCostRecord(@Param("type") int type,@Param("money")double money);

    //查看所有纪录
    List<AdminCostRecord> viewAllCostRecord(@Param("page") int page, @Param("num") int num);

    //按天查看
    List<AdminCostRecord> viewCostRecordByTimeDay(@Param("qTime") Date qTime, @Param("page") int page, @Param("num") int num, @Param("hTime")Date hTime);

    //查看流水纪录
    List<AdminCostRecordVo> viewCost(@Param("qDate") Date qDate, @Param("hDate") Date hDate, @Param("state") Integer state);

    //按类型统计钱
    Double viewBill(@Param("state") Integer state,@Param("qDate") Date qDate,@Param("hDate") Date hDate);
}
